<template>
	<view>
		<u-cell-group>
			<u-cell title="新的朋友" @click="addFriend">
				<view slot="icon" style="" class="addFriend">
					<u-icon size="32" name="man-add-fill" color="white"></u-icon>
				</view>
			</u-cell>

		</u-cell-group>
		
		<u-subsection :list="subsectionList" :current="currentSubsection" @change="subsectionChange"></u-subsection>
		<user-list v-if="currentSubsection==0" ref="userList"></user-list>
		<group-list v-if="currentSubsection==1"></group-list>
		</view>
</template>

<script>
	import userList from './userList/userList.vue'
	import groupList from './groupList/groupList.vue'
	export default {
		data() {
			return {
				subsectionList:['好友','群组'],
				currentSubsection:0
			}
		},
		components:{
			userList,
			groupList
		},
		onLoad() {
		
		},
		onShow() {
			
			
		},
		methods: {
				subsectionChange(e){
					this.currentSubsection=e
				},
	
			addFriend(){
				uni.navigateTo({
					url:'/pages/addFriend/addFriend'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.list-cell {
		display: flex;
		box-sizing: border-box;
		width: 100%;
		padding: 10px 24rpx;
		overflow: hidden;
		color: #323233;
		font-size: 14px;
		line-height: 24px;

		.headerImg {
			image {
				height: 100%;
				width: 50rpx;
			}

			margin-right: 10rpx;
		}

		.name {
			height: 100%;
			line-height: 80rpx;
		}
	}

	.deActive {
		background-color: #FFF;
	}

	.active {
		background-color: #BBBCBE;
	}

	.addFriend {
		width: 70rpx;
		height: 70rpx;
		background-color: #E1B0DF;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 10rpx;
		color: white;
		
	}
</style>
